package com.oocl.batchdata.service;

import java.util.Set;
import java.util.TreeSet;

import com.oocl.batchdata.pojo.Customer;
import com.oocl.batchdata.util.CustomersSorter;

public enum CustomerService {
	INSTANCE;

	private Set<Customer> customerList;
	
	CustomerService() {
		customerList = new TreeSet<Customer>();
	}
	
	public void addCustomer(Customer c) {
		customerList.add(c);
	}
	
	public Set<Customer> getCustomersOrderById() {
		return customerList;
	}
	
	public Set<Customer> getCustomersOrderByBirthday() {
		return CustomersSorter.sortByBirthday(customerList);
	}
}
